home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Sapphire Collection / Software Vault (Sapphire Collection) (Digital Impact).ISO / cdr08 / finst152.zip / ICTRLLER.H_ / ICTRLLER.H
C/C++ Source or Header  |  1994-07-30  |  3KB  |  118 lines

  1. #define __ICTRLLER_H
  2.  
  3. #ifndef __SAINT_H
  4. #include "saint.h"
  5. #endif
  6. #ifndef __OPRDR_H
  7. #include "oprdr.h"
  8. #endif
  9. #ifndef __RESMGR_H
  10. #include "resmgr.h"
  11. #endif
  12. #ifndef __WINDOWS_H
  13. #include "windows.h"
  14. #endif
  15. #ifndef __INSTALLR_H
  16. #include "installr.h"
  17. #endif
  18.  
  19. class dcontext;
  20.  
  21. class installinfo;
  22.  
  23. class logmover;
  24.  
  25. class installcontroller
  26. {
  27.    friend logmover;
  28.    friend LRESULT CALLBACK _export bkwndproc(HWND wnd, UINT msg, WPARAM wpara, LPARAM lpara);
  29.  
  30.    int init(HINSTANCE inst, HINSTANCE pinst);
  31.    int createshowbkwnd(HINSTANCE pinst);
  32.    void paint();
  33.    void movelog();
  34.    void drawbktxts(HDC dc);
  35.    void drawgradient(HDC dc, RECT &r);
  36.    void createbkwndclass();
  37.    HWND createbkwnd(int x, int y, int w, int h);
  38.    HFONT createbktxtf(dcontext &dc, int i);
  39.  
  40.    public:
  41.    installcontroller(int *r, HINSTANCE inst, HINSTANCE pinst);
  42.   ~installcontroller();
  43.  
  44.    int scrw;                                     /* width of screen (in pixel) */
  45.    int scrh;                                    /* height of screen (in pixel) */
  46.    int oldemode;                                        /* original error mode */
  47.    int issysinichged;                                /* is system.ini changed? */
  48.    char diri[256];                                 /* install target directory */
  49.    HWND bkwnd;                                            /* background window */
  50.    saint ics;                                    /* is the component selected? */
  51.    saint ifs;                                         /* is the file selected? */
  52.    saint iis;                                         /* is the item selected? */
  53.    saint ies;                                        /* is the entry selected? */
  54.    saint irs;                                      /* is the reg key selected? */
  55.    double pnt2pxlx;       /* horz factor to convert point (1/72 inch) to pixel */
  56.    double pnt2pxly;       /* vert factor to convert point (1/72 inch) to pixel */
  57.    double spaceneeded;                               /* hard disk space needed */
  58.    resmgr rm;                                /* free resourced when destructed */
  59.    installer ir;                                                  /* installer */
  60.    HINSTANCE inst;                                                 /* instance */
  61.    oprecorder rdr;                                       /* operation recorder */
  62.    installinfo *ii;                                 /* custom install info obj */
  63.  
  64.    virtual int run() = 0;
  65.  
  66.    char *getdiri()
  67.    {
  68.       return diri;
  69.    }
  70.    char *getdirs()
  71.    {
  72.       return ir.getdirs();
  73.    }
  74.    char *getdirw()
  75.    {
  76.       return ir.getdirw();
  77.    }
  78.    char *getdiry()
  79.    {
  80.       return ir.getdiry();
  81.    }
  82.  
  83.    int askdir();
  84.    int welcome();
  85.    int copyfiles();
  86.    int setregkeys();
  87.    int createitems();
  88.    int selectcomps();
  89.    int setinientries();
  90.    void done();
  91. };
  92.  
  93. class logmover   /* call controller to move $w\filog.ini to $i when destructed */
  94. {             
  95.    int hasmoved;
  96.  
  97.    installcontroller ⁣
  98.  
  99.    public:
  100.    logmover(installcontroller &icx):ic(icx)
  101.    {
  102.       hasmoved = 0;
  103.    }
  104.   ~logmover()
  105.    {
  106.       move();
  107.    }
  108.    void move()
  109.    {
  110.       if (!hasmoved)
  111.       {
  112.          ic.movelog();
  113.          hasmoved = 1;
  114.       }
  115.    }
  116. };
  117.  
  118.